import QtQuick 2.0
import QtQuick.Particles 2.0

//粒子方向
Rectangle {
    id: root;

    color: "black";

    //粒子系统
    ParticleSystem {
        id: particle;
    }

    //粒子发射器
    Emitter {
        id: emitter1;
        anchors.left: parent.left;
        x: 0; y: 200;
        width: 1;
        height: 1;
        system: particle;
        lifeSpan: 6400;
        lifeSpanVariation: 400;
        size: 16;
        endSize: 32;

        //角度属性
        velocity: AngleDirection {
            angle: 0;
            angleVariation: 15;
            magnitude: 100;
            magnitudeVariation: 50;
        }
    }

    //加速度
    Emitter {
        id: emitter2;
        anchors.left: parent.left;
        x: 0; y: 500;
        width: 1;
        height: 1;
        system: particle;
        lifeSpan: 6400;
        lifeSpanVariation: 400;
        size: 16;
        endSize: 32;
        //角度属性
        velocity: AngleDirection {
            angle: -45;
            magnitude: 100;
        }
        //加速度
        acceleration: AngleDirection {
            angle: 90;
            magnitude: 25;
        }
    }

    //点方向
    Emitter {
        id: emitter3;
        anchors.left: parent.left;
        x: 0; y: 600;
        width: 1;
        height: 1;
        system: particle;
        lifeSpan: 6400;
        lifeSpanVariation: 400;
        size: 16;
        endSize: 32;
        //角度属性
        velocity: PointDirection {
            x: 100;
            y: 0;
            xVariation: 0;
            yVariation: 100/6;
        }
    }

    //目标方向
    Emitter {
        id: emitter4;
        anchors.left: parent.left;
        x: 0; y: 700;
        width: 1;
        height: 1;
        system: particle;
        lifeSpan: 6400;
        lifeSpanVariation: 400;
        size: 16;
        endSize: 32;
        //角度属性
        velocity: TargetDirection {
            targetX: 100;
            targetY: 0;
            targetVariation: 100/6;
            magnitude: 100;
        }
    }

    ImageParticle {
        source: "Images/png/star.png";
        system: particle;
        color: "#FFD700";
        colorVariation: 0.6;
        rotation: 15;
        rotationVariation: 5;
        rotationVelocity: 45;
        rotationVelocityVariation: 15;
        entryEffect: ImageParticle.Scale;
    }
}
